package cn.johnyu.client;

import org.example.commons.dto.ProductDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "product-service",fallback = ProductClientFallback.class)
public interface ProductClient {
    @GetMapping(value = "/products")
    List<ProductDto> findAllProducts(); //DTO: 数据传输对象


    @GetMapping(value = "/products/{id}")
    ProductDto loadProducts(@PathVariable("id") int id); //DTO: 数据传输对象

//    String findAllProducts(int a);
}
